package com.xnyzc.lhy.mis.controller.cmsapi.login;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.mis.entity.param.cms.LoginInfo;
import com.xnyzc.lhy.mis.service.cms.login.LoginService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 后台登陆
 *
 * @Author: wangshuo
 * @Date: 2019-08-07 14:11
 */
@RestController
@RequestMapping("/cmsapi/login")
public class LoginController {

    @Autowired
    private LoginService loginService;

    /**
     * 获取登录人信息
     * @return
     */
    @ApiOperation(value = "获取登录人信息", notes = "获取登录人信息")
    @PostMapping(value = "/getUserInfo")
    public Rv getUserInfo(
            @ApiParam(name = "priceParam", value = "机构请求类") @RequestBody LoginInfo param
    ) {
        return Rv.wrap(loginService.getUserInfo(param));
    }

    /**
     * 获取登录人顶部菜单
     * @return
     */
    @ApiOperation(value = "获取登录人顶部菜单", notes = "获取登录人顶部菜单")
    @GetMapping(value = "/getUserTopMenu")
    public Rv getUserTopMenu(
    ) {
        return loginService.getUserTopMenu();
    }

}
